import Vue from 'vue'
import VueRouter from 'vue-router'

const LoginView = ()=>import(/* webpackChunkName: "login" */ '../views/Login/Login.vue')
const MainPage = ()=>import(/* webpackChunkName: "main" */ '../views/Main/Main.vue')
const HomePage = ()=>import(/* webpackChunkName: "home" */ '../views/Home/Home.vue')
const MoneyPage = ()=>import(/* webpackChunkName: "money" */ '../views/Money/Money.vue')
const AboutPage = ()=>import(/* webpackChunkName: "about" */ '../views/About/About.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path:'/main',
    component:MainPage,
    children:[
      {
        path:'home',
        component:HomePage
      },
      {
        path:'money',
        component:MoneyPage
      },
      {
        path:'about',
        component:AboutPage
      }
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
